home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MACD 5
/
MACD 5.bin
/
internet
/
irc_i_dodatki
/
narratorinstall
/
amirc
/
rexx
/
narrator.amirx
Wrap
Text File
|
1997-05-27
|
3KB
|
129 lines
/* $VER: Narrator.amirx 1.23 (25.05.97) Neil Ross <aspect@direct.ca> */
signal on syntax
OPTIONS RESULTS
nickwch=0
wds=1
cs=''
cd=''
IF~SHOW('L','rexxsupport.library') THEN IF~ADDLIB('rexxsupport.library',0,-30,0) THEN DO
CALL narmes('rexxsupport.library not available, exiting...')
EXIT
END
IF SHOW('P','NARRATOR') THEN DO
CALL NARMES('The Narrator is already running!')
EXIT
END
PRAGMA(S,20000)
ADDRESS COMMAND 'run <>NIL: sys:rexxc/muirexx Narrator/NarratorGUI.rexx port NARRATOR HELP Narrator.guide'
CALL SETCLIP('NR_INIT','0')
DO UNTIL GETCLIP('NR_INIT')='1'
CALL DELAY(25)
END
CALL getme()
CALL NARMES('Setting up, please wait...')
DO WHILE GETCLIP('NR_INIT')~='3'
IF GETCLIP('NR_STAT')='1' THEN DO
CALL SETCLIP('NR_STAT','0')
rvoice=getclip(NR_RVOIC)
smiley=getclip(NR_SMILE)
yflood=getclip(NR_YFLOO)
prvmsg=getclip(NR_PRVMS)
sp=getclip(NR_SPEED)
pt=getclip(NR_PITCH)
in=getclip(NR_INFLE)
SELECT
WHEN rvoice=1 THEN in='N'
WHEN in=0 THEN in='F'
WHEN in=1 THEN in='M'
WHEN in=3 THEN in='R'
OTHERWISE in=2
END
cl=SHOW('C')
ct=WORDS(cl)
DO i=1 TO ct
PARSE VAR cl cc.i cl
IF SUBSTR(cc.i,1,4)='NR_§' THEN cs=cc.i||" "||cs
END
cc=WORDS(cs)
DO i=1 TO cc
PARSE VAR cs cd.i cs
END
CALL SETCLIP('NR_STAT','0')
CALL SETCLIP('NR_INIT','1')
CALL NARMES('Settings loaded...')
END
CALL cruncher()
END
CALL NARMES('The Narrator has been silenced...')
EXIT
cruncher:
"GETLINE"
IF GETCLIP('NR_INIT')=1 THEN DO
whisper=DELSTR(LINE.REST,1,1)
nicker=LINE.PREFIX
msgtyp=LINE.COMMAND
IF msgtyp~='PRIVMSG' THEN RETURN
IF yflood~=1 THEN DO
IF oldnck=nicker
THEN nickwch=nickwch+1
ELSE nickwch=0
oldnck=nicker
IF nickwch>0 THEN RETURN
END
IF prvmsg=1 THEN DO
IF UPPER(line.dest)~=UPPER(mynick) THEN RETURN
END
wds=WORDS(whisper)
IF smiley=1 THEN DO
DO wrdn=1 TO wds
DO i=1 TO cc
cr=SUBSTR(cd.i,5)
IF cr=WORD(whisper,wrdn) THEN DO
cp=GETCLIP(cd.i)
wpos=WORDINDEX(whisper,wrdn)
CALL swapsmiley(cp)
ITERATE wrdn
END
END
END
END
IF rvoice=1 THEN DO
sp=TRUNC(6*wds+54)
IF sp<144 THEN sp=144
IF sp>400 THEN sp=400
pt=Random(65,320,Time(secs))
END
CALL OPEN(speaker,"SPEAK:OPT/a0/o0/"||in||"/p"||pt||"/s"||sp,'W')
CALL WRITELN(speaker,TRANSLATE(whisper,' ',':~^*/<>=''"'))
CALL CLOSE(speaker)
END
ELSE CALL DELAY(25)
RETURN
swapsmiley:
whisper=INSERT(arg(1)||" ",DELWORD(whisper,wrdn,1),wpos-1)
RETURN
narmes:
IF ARG(1)~='' THEN 'ECHO P='D2C(27)'b«Narrator» '||ARG(1)
RETURN
getme:
"GETMYNICK"
mynick=result
"USERHOST "||mynick
myserv=result
me=mynick||"!"||myserv
RETURN
syntax:
IF SIGL=93 THEN DO
CALL NARMES('Speak device not avaiable!')
EXIT
END
l=rc
erb="ERROR "||l||":"||ERRORTEXT(l)
erc="LINE "||SIGL||":"||SOURCELINE(SIGL)
"SAY /msg "||mynick||" You have found a bug!"
"SAY /msg "||mynick||"---"
"SAY /msg "||mynick||" "||erb
"SAY /msg "||mynick||" "||erc
"SAY /msg "||mynick||"---"
"SAY /msg "||mynick||" Please send the above lines by E-Mail to aspect@direct.ca"
EXIT